<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="UTF-8">
		<title>红酒会 - 智能红酒管家</title>
		<link rel="shortcut icon" type="image/x-icon" href="${ctx}/favicon.ico" />
		<link type="text/css" rel="stylesheet" href="${ctx}/static/styles/bootstrap.min.css" />
	</head>
<body>
	
	<c:import url="/header"><c:param name="module">vintry</c:param></c:import>
	<c:import url="/vintry/menu"><c:param name="menu">1</c:param></c:import>
	<c:import url="/talk/right" />
	
	<div class="outWrap">
		<div class="allnewBoxIn">
			<div class="allnew_Head">
				<c:if test="${not empty msg}">
					<div class="alert alert-success">
						<button type="button" class="close" data-dismiss="alert">&times;</button>
	  					<strong>操作成功：</strong>
	  					${msg}
					</div>
				</c:if>
			</div>
			<form id="form" action="${ctx}/vintry/wine/advice/save" method="post" class="form-horizontal">
				<input type="hidden" name="wine.id" value="${wineId}"/>
				<div class="control-group">
					<label class="control-label" for="advice">纠错建议：</label>
					<div class="controls">
						<textarea id="advice" name="advice" rows="7" style="width:90%"></textarea>
						<div id="error_advice" class="red"></div>
					</div>
				</div>
	
				<div class="control-group">
					<div class="controls">
						<button type="button" class="btn" onclick="history.back();">&nbsp;&nbsp;&nbsp;返&nbsp;&nbsp;&nbsp;回&nbsp;&nbsp;&nbsp;</button>
						<button type="submit" class="btn btn-info">&nbsp;&nbsp;&nbsp;提&nbsp;&nbsp;&nbsp;交&nbsp;&nbsp;&nbsp;</button>
	 				</div>
				</div>
			</form>
		</div>
	</div>
	
	<c:import url="/WEB-INF/views/footer.jsp" />
	
	<script type="text/javascript" src="${ctx}/static/scripts/bootstrap.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/scripts/jquery.validate.min.js"></script>
	<script type="text/javascript">
		$(function() {
			$('#form').validate({
				rules: {
					advice: {
						required: true
					}
				},
				messages: {
					advice: {
						required: '请填写纠错建议',
					}
				},
				errorElement: 'em',
				errorPlacement: function(error, element) {
					error.appendTo($("#error_" + element.attr("id")));
				},
				submitHandler: function(form) {
					form.submit();
				}
			});
		});
	</script>
</body>
</html>